package com.varian.system.dto;

import com.varian.system.enums.MenuTypeEnum;
import com.varian.tool.enums.CommonStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * @author ben
 * @since 2024/7/2
 */
@Data
@Schema(title = "菜单数据对象")
public class SysMenuDTO {
    @Schema(title = "上级菜单id")
    private Long parentId;
    @Schema(title = "菜单名称")
    @NotBlank(message = "菜单名称不能为空")
    private String menuName;
    @Schema(title = "菜单编码")
    @NotBlank(message = "菜单编码不能为空")
    private String permissionCode;
    @Schema(title = "菜单图标")
    private String menuIcon;
    @Schema(title = "菜单类型")
    @NotNull(message = "菜单类型不能为空")
    private MenuTypeEnum menuType;
    @Schema(title = "菜单路径")
    @NotBlank(message = "菜单路径不能为空", groups = {MenuTypeEnum.MenuGroup.class, MenuTypeEnum.LinkGroup.class, MenuTypeEnum.EndpointGroup.class})
    private String menuPath;
    @Schema(title = "请求方式")
    @NotBlank(message = "请求方式不能为空", groups = {MenuTypeEnum.EndpointGroup.class})
    private String httpMethod;
    @Schema(title = "组件路径")
    @NotBlank(message = "组件路径不能为空", groups = {MenuTypeEnum.MenuGroup.class})
    private String componentPath;
    @Schema(title = "菜单状态")
    @NotNull(message = "菜单状态不能为空")
    private CommonStatusEnum menuStatus;
    @Schema(title = "菜单权重")
    private Integer menuWeight;
}
